package com.glh.javalogic.chapter4.doubleedged;

/**
 * <pre>
 *     author : 高磊华
 *     e-mail : 984992087@qq.com
 *     time   : 2018/08/18
 *     desc   : 子类 (继承是把双刃剑)
 *     version: 1.0
 * </pre>
 */
public class ChildV1 extends BaseV1 {
	
	private long sum;

	@Override
	public void add(int number) {
//		super.add(number);
		sum+=number;
	}

	@Override
	public void addAll(int[] numbers) {
//		super.addAll(numbers);
		for (int i = 0; i < numbers.length; i++) {
			sum += numbers[i];
		}
	}
	
	public long getSum() {
		return sum;
	}
}